import request from '@/utils/request'

/**
 * 提交意见反馈
 * @param {Object} data: { title: 标题, content: 内容 }
 * @return Promise
 */
export const addFeedbackAPI = (data) => {
  return request({
    url: '/reception/feedback/',
    method: 'POST',
    data
  })
}

/**
 * 获取意见反馈列表
 * @param {Object} data: { page: 页码, pagesize: 每页条数, type: 反馈人类型 }
 * @return Promise
 */
export const getFeedbackListAPI = (params) => {
  return request({
    url: '/manage/feedback/',
    params
  })
}

/**
 * 根据title模糊查询意见反馈
 * @param {Object} data: { page: 页码, pagesize: 每页条数, title: 反馈标题 }
 * @return Promise
 */
export const queryFeedbackAPI = (params) => {
  return request({
    url: '/manage/feedback/query',
    params
  })
}

/**
 * 获取意见反馈信息
 * @param id
 * @return Promise
 */
export const getFeedbackInfoAPI = (id) => {
  return request({
    url: `/manage/feedback/${id}`
  })
}
